package com.wx.datastructure.linked;

/**
 * @author wx
 * @Description: 双向链表测试
 * @date 2018/12/18 001814:53
 */
public class BothwayLinkedListMain {
    public static void main(String[] agrs){
        BothwayLinkedList<String>  linkedList = new BothwayLinkedList<>();
        linkedList.add(0,"1");
        System.out.println(linkedList.getSize());
        System.out.println(linkedList.getFirst());
        System.out.println(linkedList.getLast());
        System.out.println(linkedList);
        System.out.println("####################1");
        linkedList.add(1,"2");
        System.out.println(linkedList.getSize());
        System.out.println(linkedList.getFirst());
        System.out.println(linkedList.getLast());
        System.out.println(linkedList);
        System.out.println("####################2");
        linkedList.add(2,"3");
        System.out.println(linkedList.getSize());
        System.out.println(linkedList.getFirst());
        System.out.println(linkedList.getLast());
        System.out.println(linkedList);
        System.out.println("####################3");
        linkedList.add(3,"4");
        System.out.println(linkedList.getSize());
        System.out.println(linkedList);
        System.out.println("####################4");
        System.out.println(linkedList.contains("wxx"));
        linkedList.set(2,"3.1");
        System.out.println(linkedList.contains("wxx"));
        System.out.println(linkedList);
        System.out.println("####################5");
        System.out.println(linkedList.removeFirst());
        System.out.println(linkedList);
        System.out.println("####################6");
        System.out.println(linkedList.removeLast());
        System.out.println(linkedList);
        System.out.println("####################7");
        linkedList.add(1,"1.1");
        System.out.println(linkedList);
        linkedList.removeElement("3.1");
        System.out.println(linkedList);
    }
}
